#!/usr/bin/make
# $Id: Makefile.common,v 1.1 2004/09/12 03:40:35 poine Exp $

# The helicopter definitions are:
#	0	Simulator
#	1	Nova
#	2	Concept 60
#	3	Bergen Twin
#	4	Bergen Observer

HELI		=	0

# The serial numbers select IMU calibration values and orientations
# on the helicopter.  Current ones are:
#	0	User defined (fill in yourself)
#	1	Shared between the Nova and Observer
#	2	SPSU

SERIAL_NUMBER	= 1

# Supported arch's are:
#	i386	Linux on i386 hardware (most users)
#	macosx	Mac OS X (not fully supported)
#	arm	Linux on StrongARM and xscale (most flight controllers)

ARCH	= i386


ARM_ARCH		=						\
	-ieee								\
	-ffast-math							\
	-fomit-frame-pointer						\
	-march=armv4							\
	-DNO_FPU							\

ARM_PATH	= /usr/local/arm/2.95.3
arm_CC		= $(ARM_PATH)/bin/arm-linux-gcc $(ARM_ARCH)
arm_CXX		= $(ARM_PATH)/bin/arm-linux-g++ $(ARM_ARCH)
arm_RANLIB	= $(ARM_PATH)/bin/arm-linux-ranlib

i386_CC		= gcc
i386_CXX	= g++
i386_RANLIB	= ranlib

CC		= $($(ARCH)_CC)
CXX		= $($(ARCH)_CXX)
RANLIB		= $($(ARCH)_RANLIB)

LD		= $(CXX)
MAKEDEPEND	= $(CXX) -M

ROOTDIR		= ../..
BINDIR		= $(ROOTDIR)/bin/$(ARCH)
OBJDIR		= $(ROOTDIR)/obj/$(ARCH)
LIBDIR		= $(ROOTDIR)/lib/$(ARCH)

NO=\
	-g -pg								\

CFLAGS		=							\
	-DHELI=$(HELI)							\
	-DSERIAL_NUMBER=$(SERIAL_NUMBER)				\
	-O3								\
	-W								\
	-Wall								\
	-I.								\
	-I..								\
	-I../include							\
	-I../state							\


CXXFLAGS	=							\
	$(CFLAGS)							\


LDFLAGS		=							\

LDLIBS		=							\
	-lm								\
	-pg								\
	-L../../lib							\

GL_LDFLAGS	=							\
	`fltk-config --ldflags --use-gl --use-glut`			\

GL_CFLAGS	=							\
	`fltk-config --cflags --use-gl --use-glut`			\


# Bring in our generic rules and targets
include $(ROOTDIR)/Makefile.rules

# Libraries just descend into the top level directory
# and do the update there
FORCE:

$(LIBDIR)/lib%.a: FORCE
	$(MAKE) -C $(ROOTDIR)/src/$(*:lib=) lib



